package com.taoym.voucher.xcx.controller;

import com.taoym.voucher.common.response.Response;
import com.taoym.voucher.xcx.entity.vo.XcxGetDicEnumVO;
import com.taoym.voucher.xcx.service.XcxDicEnumService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.constraints.NotBlank;
import java.util.List;

/**
 * @coder taoym
 * @datetime 2021/6/5 10:15
 * @desc 枚举字典控制器
 */
@Api(tags = "枚举字典")
@RestController
@RequestMapping("/dic")
public class XcxDicEnumController {

    @Autowired
    private XcxDicEnumService xcxDicEnumService;

    @ApiOperation("查询枚举字典")
    @GetMapping("/get")
    public Response<List<XcxGetDicEnumVO>> getDicEnum(@RequestParam @NotBlank(message = "类型不能为空") String type) {
        return Response.success(xcxDicEnumService.getDicEnum(type));
    }
}
